import {createMemoryHistory,createRouter} from 'vue-router'
import Login   from "@/components/Login.vue";
import Home   from "@/components/Home.vue";
import Manager from "@/components/Manager.vue";
import Book from "@/components/Book.vue";
import Info from "@/components/Info.vue";
//路由的数组
//path路径
//component组件实例
//alt+enter导包
//"/"这是默认路径
export const routes = [
    {path:'/home',component:Home,name: 'Home'},
    {path:'/login',component:Login,name:'login'},
    {
        path: '/manager', component: Manager, name: 'manager', children: [
            {path: 'book', component: Book, name: 'book'},
            {path: 'info', component: Info, name: 'info'},
        ]
    },
]
//创建路由对象
export const router = createRouter({
    history: createMemoryHistory(),
    routes,
})
